package com.esri.core.geometry;

/* loaded from: classes.dex */
public class Latlon {
    public static Point[] createPoints(double[][] dArr) {
        if (dArr == null || dArr.length < 1) {
            return null;
        }
        int length = dArr.length;
        Point[] pointArr = new Point[length];
        for (int i = 0; i < length; i++) {
            pointArr[i] = new Point(dArr[i][1], dArr[i][0]);
        }
        return pointArr;
    }

    public static Polyline createPolyline(double[][] dArr) {
        if (dArr == null || dArr.length < 2) {
            return null;
        }
        Polyline polyline = new Polyline();
        polyline.startPath(dArr[0][1], dArr[0][0]);
        for (int i = 1; i < dArr.length; i++) {
            polyline.lineTo(dArr[i][1], dArr[i][0]);
        }
        return polyline;
    }

    public static Polygon createPolygon(double[][] dArr) {
        if (dArr == null || dArr.length < 3) {
            return null;
        }
        Polygon polygon = new Polygon();
        polygon.startPath(dArr[0][1], dArr[0][0]);
        for (int i = 1; i < dArr.length; i++) {
            polygon.lineTo(dArr[i][1], dArr[i][0]);
        }
        polygon.closeAllPaths();
        return polygon;
    }
}
